package com.jxpowernode.bitcon.service.btcservice;

import com.jxpowernode.bitcon.Constants;

import java.util.Base64;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author: Lixuewei
 * @Email:1410511702@qq.com
 * @Desc: 该类有用减少冗余
 * @Date: 2021/12/13 19:31
 */
public class GetBitconService {
    /**
     * 该方法用于对获取bitf方法的简化
     * @return
     */
    public Map<String,String> getBitcon(){
        String author = Constants.RPC_USER + ":" +Constants.RPC_PASSWORD;
        Base64.Encoder encoder = Base64.getEncoder();
        String authorbase64 = encoder.encodeToString(author.getBytes());
        Map<String,String> map = new HashMap<String, String>();
        map.put("ContentType","application/json");
        map.put("Authorization","Basic " + authorbase64);
        return map;
    }
}
